package com.web44.spring.service.impl;

import com.web44.spring.service.Calculator;
import org.springframework.stereotype.Component;

/**
 * @Title: CalculatorImpl
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2024/1/9 14:00
 * 目标类
 */
@Component
public class CalculatorImpl implements Calculator {

    /**
     * 切入点
     * @param i
     * @param j
     * @return
     */
    @Override
    public int add(int i, int j) {
        int result = i + j;
        System.out.println("方法内部 result = " + result);
        return result;
    }

    @Override
    public String fun(int i, int j) {
       // System.out.println(1/0);
        int result = i + j;
        System.out.println("方法内部 result = " + result);
        return ""+result;

    }

    @Override
    public int add(int i, int j,int k) {
        int result = i + j+k;
        System.out.println("方法内部 result = " + result);
        return result;
    }

    @Override
    public int sub(int i, int j) {
        int result = i - j;
        System.out.println("方法内部 result = " + result);
        return result;
    }

    @Override
    public int mul(int i, int j) {

        int result = i * j;
        System.out.println("方法内部 result = " + result);

        return result;
    }

    @Override
    public int div(int i, int j) {
        int result = i / j;
        System.out.println("方法内部 result = " + result);
        return result;
    }
}
